# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Andreas Wagner <Andreas dot Wagner at em dot uni-frankfurt dot de>

pkgname=liblockfile
pkgver=1.17_1
_basever=1.17
pkgrel=3
pkgdesc="a library with NFS-safe locking functions"
arch=('loong64' 'x86_64')
license=('GPL')
url="https://packages.debian.org/unstable/libs/liblockfile1"
depends=('glibc')
makedepends=()
source=(https://ftp.debian.org/debian/pool/main/libl/$pkgname/${pkgname}_${_basever}.orig.tar.gz
	https://ftp.debian.org/debian/pool/main/libl/$pkgname/${pkgname}_${pkgver/_/-}.debian.tar.bz2)
sha256sums=('6e937f3650afab4aac198f348b89b1ca42edceb17fb6bb0918f642143ccfd15e'
            'e3657c0e3facfeccb58900c0b48d56cd68ad5f9f24d1b4c6eaa69c26490fb673')

build() {
  cd "$srcdir"/$pkgname-${_basever}
  for p in `cat ../debian/patches/series` ; do
    patch -p1 < ../debian/patches/$p
  done
  LDCONFIG=/usr/bin/true ./configure --enable-shared --prefix=/usr --mandir=/usr/share/man
  make
}

package() {
  cd "$srcdir"/$pkgname-${_basever}
  mkdir -p "$pkgdir"/usr/{lib,bin,include,share/man/man1,share/man/man3}
  make install prefix="$pkgdir"/usr mandir="$pkgdir"/usr/share/man
}
